package com.orafl.use.comorafluse.controller;

import com.alibaba.fastjson.JSONObject;
import com.orafl.use.comorafluse.autoConfiguration.AutoConfigBiz;
import com.orafl.use.comorafluse.conditionDemo.DocClass;
import com.orafl.use.comorafluse.propertiesDemo.EmployeesInfo;
import com.peixun.common.demo.person.PersonDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class propertiesTest {
    @Autowired
    private EmployeesInfo employees;

    @Autowired
    private ConfigurableApplicationContext applicationContext;

    @RequestMapping("/getEmployeeInfo")
    public EmployeesInfo getEmployeeInfo() {
        return employees;
    }

    @RequestMapping("/checnkRegisterClass")
    public String checnkRegisterClass(){
        DocClass dclass = applicationContext.getBean(DocClass.class);
        return JSONObject.toJSONString(dclass);
    }

    @Autowired
    private PersonDTO personDTO;

    @Autowired
    private AutoConfigBiz biz;


    @RequestMapping("/getperson")
    public String getPerson(){
        //Object o = applicationContext.getBean("car");
        return JSONObject.toJSONString(personDTO);
    }

    @RequestMapping("/getCar")
    public String getCar(){
        Object o = applicationContext.getBean("car");
        return JSONObject.toJSONString(o);
    }


    public static void main(String[] args) {
        String aa = "000077";
        Integer ss  = Integer.valueOf(aa);

        System.out.println(String.format("sa%07d",ss));
    }
}
